<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>


    for (var i = 0; i < 10; i++) {
      console.log("Hello World:", i)
    }

    var names = ['abc', 'cba', 'nba', 'mba']
    for (var i = 0; i < names.length; i++) {
      console.log(names[i])
    }

    console.log("打印0~99")
    var totalCount = 0
    var totalCount1 = 0
    for (var i = 0; i < 100; i++) {
      console.log(i)
      totalCount += i
      if (i % 2 !== 0) {
        totalCount1 += i
      }
    }
    console.log("totalCount:", totalCount)
    console.log("奇数和:", totalCount1)

    var totalCount1 = 0
    for (var i = 1; i < 100; i += 2) {
      totalCount1 += i
    }
    console.log("奇数和:", totalCount1)


  </script>
</body>

</html>